import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import { createPinia } from 'pinia' 
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router/router'
import axios from '../src/axios/axiosInstance.js'
import piniaPluginPersist from 'pinia-plugin-persist'

// 1. 引入 Element Plus 图标库（关键补充）
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
const pinia = createPinia()

pinia.use(piniaPluginPersist)
app.use(pinia)
app.use(ElementPlus)
app.use(router)
app.config.globalProperties.$axios = axios;

// 2. 注册所有图标（关键补充）
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.mount('#app')